<?php
        require("./Utils.php");

        $post = getJsonParamter();

        $id = $post['id'];
        $imgUrl = $post['imgUrl'];

        $conn = getConnection();
        $sql = "UPDATE pet SET image = ? WHERE id = ?";

        $result = execute($conn, $sql, $imgUrl, $id);

        if($result){
            getJson(200, '更新图片成功', null);
        }else{
            getJson(500, '更新图片失败', null);
        }
?>